package net.sk.china.platform.service.order;

import com.baomidou.mybatisplus.extension.service.IService;
import net.sk.china.common.model.order.StoreOrder;
import net.sk.china.platform.request.order.StoreOrderRefundRequest;
import net.sk.china.platform.request.order.StoreOrderSearchRequest;
import net.sk.china.platform.request.order.StoreOrderSendRequest;
import net.sk.china.platform.request.order.StoreOrderUpdatePriceRequest;
import net.sk.china.platform.response.order.*;
import net.sk.china.common.request.PageParamRequest;
import net.sk.china.common.response.CommonPage;
import net.sk.china.common.vo.LogisticsResultVo;

import java.util.List;

/**
 * StoreOrderService 接口
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/3 21:52
 * +----------------------------------------------------------------------
 */
public interface StoreOrderService extends IService<StoreOrder> {

    /**
     * 列表（PC）
     * @param request 请求参数
     * @param pageParamRequest 分页类参数
     * @return {@code CommonPage<StoreOrderDetailResponse>}
     */
    CommonPage<StoreOrderDetailResponse> getAdminList(StoreOrderSearchRequest request, PageParamRequest pageParamRequest);

    /**
     * 创建订单
     * @param storeOrder 订单参数
     * @return {@code boolean}
     */
    boolean create(StoreOrder storeOrder);

    /**
     * 退款
     * @param request 请求对象
     * @return {@code boolean}
     */
    boolean refund(StoreOrderRefundRequest request);

    /**
     * 订单详情（PC）
     * @param orderNo 订单编号
     * @return {@code StoreOrderInfoResponse}
     */
    StoreOrderInfoResponse info(String orderNo);

    /**
     * 发送货物
     * @param request 请求对象
     * @return {@code Boolean}
     */
    Boolean send(StoreOrderSendRequest request);

    /**
     * 订单备注
     * @param orderNo 订单编号
     * @param mark 备注
     * @return {@code Boolean}
     */
    Boolean mark(String orderNo, String mark);

    /**
     * 拒绝退款
     * @param orderNo 订单编号
     * @param reason String 原因
     * @return {@code Boolean}
     */
    Boolean refundRefuse(String orderNo, String reason);

    /**
     * 获取订单快递信息
     * @param orderNo 订单编号
     * @return {@code LogisticsResultResponse}
     */
    LogisticsResultVo getLogisticsInfo(String orderNo);

    /**
     * 根据时间参数统计订单价格
     * @param dateLimit 时间区间
     * @param type 1=price 2=订单量
     * @return {@code StoreOrderStatisticsResponse}
     */
    StoreOrderStatisticsResponse orderStatisticsByTime(String dateLimit, Integer type);

    /**
     * 通过订单号获取数据
     * @param orderId 订单号
     * @return {@code StoreOrder}
     */

    StoreOrder getByOderId(String orderId);

    /**
     * 获取面单默认配置信息
     * @return {@code ExpressSheetResponse}
     */
    ExpressSheetResponse getDeliveryInfo();


    /**
     * 订单改价
     * @param request 改价请求对象
     * @return {@code Boolean}
     */
    Boolean updatePrice(StoreOrderUpdatePriceRequest request);

    /**
     * 获取订单状态数量
     * @param dateLimit 时间
     * @param type 订单类型：0普通订单，1-视频号订单, 2-全部订单
     * @return {@code StoreOrderCountItemResponse}
     */
    StoreOrderCountItemResponse getOrderStatusNum(String dateLimit, Integer type);

    /**
     * 获取订单统计数据
     * @param dateLimit 时间
     * @return {@code StoreOrderTopItemResponse}
     */
    StoreOrderTopItemResponse getOrderData(String dateLimit);

    /**
     * 订单删除
     * @param orderNo 订单编号
     * @return {@code Boolean}
     */
    Boolean delete(String orderNo);

    /**
     * 按开始结束时间分组订单
     * @param date String 时间范围
     * @param lefTime int 截取创建时间长度
     * @return {@code HashMap<String, Object>}
     */
    List<StoreOrder> getOrderGroupByDate(String date, int lefTime);

    /**
     * 根据用户uid查询所有已支付订单
     * @param userId 用户uid
     * @param pageParamRequest 分页参数
     * @return {@code List<StoreOrder>}
     */
    List<StoreOrder> findPaidListByUid(Integer userId, PageParamRequest pageParamRequest);

    /**
     * 获取所有收货订单id集合
     * @return {@code List<StoreOrder>}
     */
    List<StoreOrder> findIdAndUidListByReceipt();
}
